
 /**
 * LogoutAction.java.java.
 * User: BrianChen Date: 2012-7-21 上午11:08:36
 *
 * Copyright (c) 2009 Hewlett-Packard Development Company, L.P.
 * All rights reserved.
 */
package com.collapsar.snail.user.action;

import com.collapsar.core.action.BaseStrutsAction;
import com.collapsar.core.util.GlobalConstants;

/**
 * <pre>
 * REVISIONS: 
 * Version 	Date 		Author 			Description
 * ------------------------------------------------------------------- 
 * 1.0 		2012-7-21 	BrianChen 	1. Created this class. 
 * </pre>
 * 
 * @author BrianChen
 * @date 2012-7-21 上午11:08:36
 * @version 1.0
 * @see
 * 
 */
@SuppressWarnings("serial")
public class LogoutAction extends BaseStrutsAction{

	@Override
	public String execute() throws Exception {
		String userAccount = (String)this.request.getSession().getAttribute(GlobalConstants.CURRENT_USER);
		logger.info("come to logoutAction: userAccount="+ userAccount);
		if(userAccount != null){
			this.request.getSession().removeAttribute(GlobalConstants.CURRENT_USER);
			this.request.getSession().setAttribute("topMenuId", "sys_home");
			return "index";
		}else{
			return null;
		}
		
	}

}

